<template>
  <div>
    <el-button type="primary" @click="onAdd">添加</el-button>
    <v-list :flag="flag"></v-list>
    <v-form :flag="flag"></v-form>
  </div>
</template>
<script>
import vList from "./components/list.vue";
import vForm from "./components/form.vue";
import { mapGetters, mapActions } from "vuex";
export default {
  data() {
    return {
      flag: {
        isShow: false,
        isAdd: true
      }
    };
  },
  props: [],
  components: {
    vList,
    vForm
  },
  computed: {},
  methods: {
    ...mapActions({
      reqCateList: "cate/reqCateList"
    }),
    onAdd() {
      this.flag.isShow = true;
      this.flag.isAdd = true;
    }
  },
  mounted() {
    this.reqCateList();
  }
};
</script>
<style lang="less" scoped>
</style>